home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / art&graf.ix / art-3488 / macros / boltnut.aim < prev    next >
Text File  |  1986-08-03  |  885b  |  25 lines

  1. * Separation of Bolts and Nuts
  2. * (with one nut laying on its side)
  3. *
  4. * A model-directed solution
  5. * (see the chapter "Steps in Image Analysis"
  6. * of "Image Processing - a first introduction",
  7. * a section of the AIM Manual which is available
  8. * at ComMedia, Leidsekade 98, 1017 PP Amsterdam)
  9. *
  10. * Strategy:
  11. * The skeleton of a nut has a vertice resulting
  12. * from the T-form, that of a bolt is a ring or
  13. * a line (for the one on its side).
  14. *
  15. readf IMAGES\BOLTNUT.IM,A
  16. thresh A,B,1,134   * segmentation
  17. inv 1,B            * objects should be  white
  18. bcopy 1,2,B,B      * save a copy in bitplane 2
  19. erosion 1,1,6,0,B  * smooth the contours by
  20. dilation 1,1,6,0,B * ..some erosion/dilation
  21. skelet 100,1,0,B   * find the skeletons
  22. vertices 1,0,B     * only bolts have vertices!
  23. prop 100,1,2,6,0,B * now the bolts in bitplane 1
  24. exor 1,2,3,B       * and the nuts in bitplane 3
  25.